import { Resvg } from "@resvg/resvg-js"; import type { APIContext, InferGetStaticPropsType } from "astro"; import satori, { type SatoriOptions } from "satori"; import { html } from "satori-html"; import RobotoMonoBold from "@/assets/roboto-mono-700.ttf"; import RobotoMono from "@/assets/roboto-mono-regular.ttf"; import { getAllPosts } from "@/data/post"; import { siteConfig } from "@/site.config"; import { getFormattedDate } from "@/utils/date"; const ogOptions: SatoriOptions = { // debug: true, fonts: [ { data: Buffer.from(RobotoMono), name: "Roboto Mono", style: "normal", weight: 400, }, { data: Buffer.from(RobotoMonoBold), name: "Roboto Mono", style: "normal", weight: 700, }, ], height: 630, width: 1200, }; const markup = (title: string, pubDate: string) => html`
${pubDate}
${siteConfig.title}
by ${siteConfig.author}